package com.xiaoxing.salesclient.mvp.ui.adapter;

import android.content.Context;
import android.support.annotation.Nullable;
import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.xiaoxing.salesclient.mvp.model.entity.AppointTime;

import java.util.List;

import xiaoxing.com.salesclient.R;


public class AppointTimeAdapter extends BaseQuickAdapter<AppointTime.DataBean.ListBean, BaseViewHolder> {

    private Context mContext;

    public AppointTimeAdapter(Context context, @Nullable List<AppointTime.DataBean.ListBean> data) {
        super(R.layout.item_appoint_time, data);
        this.mContext = context;
    }

    @Override
    protected void convert(BaseViewHolder helper, AppointTime.DataBean.ListBean item) {

        helper.setText(R.id.tv_shi_jian_duan, item.getValue());

        TextView tv_zhuang_tai = helper.getView(R.id.tv_zhuang_tai);
        if (item.getStatus() == 1) {
            tv_zhuang_tai.setBackground(mContext.getResources().getDrawable(R.drawable.shape_yi_shi_shi_jian_red));
        } else {
            tv_zhuang_tai.setBackground(mContext.getResources().getDrawable(R.drawable.shape_yi_shi_shi_jian_lv));
        }
    }

}
